3.332 \(\int \frac{\cos ^2(c+d x) \cot (c+d x)}{a+b \sin (c+d x)} \, dx\)

Optimal. Leaf size=59 \[ \frac{\left (a^2-b^2\right ) \log (a+b \sin (c+d x))}{a b^2 d}+\frac{\log (\sin (c+d x))}{a d}-\frac{\sin (c+d x)}{b d} \]

[Out]

Log[Sin[c + d*x]]/(a*d) + ((a^2 - b^2)*Log[a + b*Sin[c + d*x]])/(a*b^2*d) - Sin[c + d*x]/(b*d)

________________________________________________________________________________________

Rubi [A]  time = 0.107853, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.111, Rules used = {2837, 12, 894} \[ \frac{\left (a^2-b^2\right ) \log (a+b \sin (c+d x))}{a b^2 d}+\frac{\log (\sin (c+d x))}{a d}-\frac{\sin (c+d x)}{b d} \]

Antiderivative was successfully verified.

[In]

Int[(Cos[c + d*x]^2*Cot[c + d*x])/(a + b*Sin[c + d*x]),x]

[Out]

Log[Sin[c + d*x]]/(a*d) + ((a^2 - b^2)*Log[a + b*Sin[c + d*x]])/(a*b^2*d) - Sin[c + d*x]/(b*d)

Rule 2837

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d*x)/b)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rubi steps

\begin{align*} \int \frac{\cos ^2(c+d x) \cot (c+d x)}{a+b \sin (c+d x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{b \left (b^2-x^2\right )}{x (a+x)} \, dx,x,b \sin (c+d x)\right )}{b^3 d}\\ &=\frac{\operatorname{Subst}\left (\int \frac{b^2-x^2}{x (a+x)} \, dx,x,b \sin (c+d x)\right )}{b^2 d}\\ &=\frac{\operatorname{Subst}\left (\int \left (-1+\frac{b^2}{a x}+\frac{a^2-b^2}{a (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{b^2 d}\\ &=\frac{\log (\sin (c+d x))}{a d}+\frac{\left (a^2-b^2\right ) \log (a+b \sin (c+d x))}{a b^2 d}-\frac{\sin (c+d x)}{b d}\\ \end{align*}

Mathematica [A]  time = 0.0751889, size = 53, normalized size = 0.9 \[ \frac{\left (a^2-b^2\right ) \log (a+b \sin (c+d x))-a b \sin (c+d x)+b^2 \log (\sin (c+d x))}{a b^2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(Cos[c + d*x]^2*Cot[c + d*x])/(a + b*Sin[c + d*x]),x]

[Out]

(b^2*Log[Sin[c + d*x]] + (a^2 - b^2)*Log[a + b*Sin[c + d*x]] - a*b*Sin[c + d*x])/(a*b^2*d)

________________________________________________________________________________________

Maple [A]  time = 0.073, size = 68, normalized size = 1.2 \begin{align*} -{\frac{\sin \left ( dx+c \right ) }{bd}}+{\frac{a\ln \left ( a+b\sin \left ( dx+c \right ) \right ) }{{b}^{2}d}}-{\frac{\ln \left ( a+b\sin \left ( dx+c \right ) \right ) }{da}}+{\frac{\ln \left ( \sin \left ( dx+c \right ) \right ) }{da}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*cot(d*x+c)/(a+b*sin(d*x+c)),x)

[Out]

-sin(d*x+c)/b/d+1/d/b^2*a*ln(a+b*sin(d*x+c))-1/d/a*ln(a+b*sin(d*x+c))+ln(sin(d*x+c))/a/d

________________________________________________________________________________________

Maxima [A]  time = 0.96684, size = 73, normalized size = 1.24 \begin{align*} \frac{\frac{\log \left (\sin \left (d x + c\right )\right )}{a} - \frac{\sin \left (d x + c\right )}{b} + \frac{{\left (a^{2} - b^{2}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a b^{2}}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*cot(d*x+c)/(a+b*sin(d*x+c)),x, algorithm="maxima")

[Out]

(log(sin(d*x + c))/a - sin(d*x + c)/b + (a^2 - b^2)*log(b*sin(d*x + c) + a)/(a*b^2))/d

________________________________________________________________________________________

Fricas [A]  time = 1.96669, size = 131, normalized size = 2.22 \begin{align*} \frac{b^{2} \log \left (-\frac{1}{2} \, \sin \left (d x + c\right )\right ) - a b \sin \left (d x + c\right ) +{\left (a^{2} - b^{2}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a b^{2} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*cot(d*x+c)/(a+b*sin(d*x+c)),x, algorithm="fricas")

[Out]

(b^2*log(-1/2*sin(d*x + c)) - a*b*sin(d*x + c) + (a^2 - b^2)*log(b*sin(d*x + c) + a))/(a*b^2*d)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos ^{2}{\left (c + d x \right )} \cot{\left (c + d x \right )}}{a + b \sin{\left (c + d x \right )}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*cot(d*x+c)/(a+b*sin(d*x+c)),x)

[Out]

Integral(cos(c + d*x)**2*cot(c + d*x)/(a + b*sin(c + d*x)), x)

________________________________________________________________________________________

Giac [A]  time = 1.25766, size = 76, normalized size = 1.29 \begin{align*} \frac{\frac{\log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a} - \frac{\sin \left (d x + c\right )}{b} + \frac{{\left (a^{2} - b^{2}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a b^{2}}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*cot(d*x+c)/(a+b*sin(d*x+c)),x, algorithm="giac")

[Out]

(log(abs(sin(d*x + c)))/a - sin(d*x + c)/b + (a^2 - b^2)*log(abs(b*sin(d*x + c) + a))/(a*b^2))/d